package com.android.firstgame;
import android.graphics.Color;
public class Actor{
	private static int TYPE_MAIN_CHARACTER = 0;
	private static int TYPE_ENEMY_NORMAL = 1;
	private static int TYPE_ENEMY_DARK = 2;
	private static int TYPE_ENEMY_ATTACK = 3;
	private static int TYPE_ENEMY_DEFEND = 4;
	private static int TYPE_BOSS = 5;
	private int i_actor_type;
	private int i_actor_hp;
	private int i_actor_radius;
	private float f_actor_pos_x;
	private float f_actor_pos_y;
	private float f_actor_gun_posx, f_actor_gun_posy;
	private double d_actor_move_angle, d_actor_gun_angle;
	private static int i_actor_gun_length;
	
	private Color o_actor_color;
	private boolean b_is_hit;
	public Actor(int x, int y, int type, int radius){
		f_actor_pos_x = x;
		f_actor_pos_y = y;
		i_actor_type = type;
		i_actor_radius = radius;
		i_actor_gun_length = i_actor_radius + i_actor_radius/2;
		d_actor_gun_angle =  Math.toRadians(180);
		d_actor_move_angle = 0;
		f_actor_gun_posx = (float)((double)f_actor_pos_x + i_actor_gun_length*Math.sin(d_actor_gun_angle));
		f_actor_gun_posy = (float)((double)f_actor_pos_y + i_actor_gun_length*Math.cos(d_actor_gun_angle));
	}
	public int getActorType(){
		return i_actor_type;
	}
	public int getActorRadius(){
		return i_actor_radius;
	}
	public float getX(){
		return f_actor_pos_x;
	}
	public float getY(){
		return f_actor_pos_y;
	}
	public float getGunPosX(){
		return f_actor_gun_posx;
	}
	public float getGunPosY(){
		return f_actor_gun_posy;
	}
	public double getMoveAngle(){
		return d_actor_move_angle;
	}
	public double getGunAngle(){
		return d_actor_gun_angle;
	}
	public Color getActorColor(){
		return o_actor_color;
	}
	public int getActorGunLength(){
		return i_actor_gun_length;
	}
	public void setPosition(float new_x, float new_y){
		f_actor_pos_x = new_x;
		f_actor_pos_y = new_y;
		f_actor_gun_posx = (float)((double)f_actor_pos_x + i_actor_gun_length*Math.sin(d_actor_gun_angle));
		f_actor_gun_posy = (float)((double)f_actor_pos_y + i_actor_gun_length*Math.cos(d_actor_gun_angle));
	}	
	public void setGunPosition(float new_x, float new_y){
		f_actor_gun_posx = new_x;
		f_actor_gun_posy = new_y;
	}
	public void setMoveAngle(double new_angle){
		d_actor_move_angle = new_angle;
	}
	public void setGunAngle(double new_angle){
		d_actor_gun_angle = new_angle;
	}
	public boolean isDead(){
		return (i_actor_hp <= 0);
	}
}